home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / src / fig10_02.jar / Ch10 / Fig10_02 / Cylindr1.h < prev    next >
C/C++ Source or Header  |  1997-10-28  |  566b  |  25 lines

  1. // Fig. 10.2: cylindr1.h
  2. // Definition of class Cylinder
  3. #ifndef CYLINDR1_H
  4. #define CYLINDR1_H
  5. #include "circle1.h"
  6.  
  7. class Cylinder : public Circle {
  8. public:
  9.    // default constructor
  10.    Cylinder( double h = 0.0, double r = 0.0,
  11.              int x = 0, int y = 0 );
  12.  
  13.    void setHeight( double );
  14.    double getHeight();
  15.    virtual double area() const;
  16.    virtual double volume() const;
  17.    virtual void printShapeName() const {cout << "Cylinder: ";}
  18.    virtual void print() const;
  19. private:
  20.    double height;   // height of Cylinder
  21. };
  22.  
  23. #endif
  24.  
  25.